package com.xuecheng.content.agent;


import com.xuecheng.api.teaching.model.dto.CompanyDTO;
import com.xuecheng.api.teaching.model.dto.WorkDTO;
import com.xuecheng.common.constant.XcFeignServiceNameList;
import com.xuecheng.common.domain.response.RestResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Map;

/**
 * Feign远程调用 教学机构管理
 */
@FeignClient(value = XcFeignServiceNameList.XC_TEACHING_SERVICE)
public interface TeachingApiAgent {

    String SERVICE_CONTEXT_PRE = "/teaching";

    /**
     * 根据租户Id获取机构信息（机构时一种租户）
     *
     * @param tenantId
     * @return
     */
    @GetMapping(SERVICE_CONTEXT_PRE + "/l/company/{tenantId}")
    CompanyDTO getCompInfoDetail(@PathVariable(value = "tenantId") Long tenantId);


    @GetMapping("teaching/l/work/{workId}")
    RestResponse<WorkDTO> getByWorkId(@PathVariable Long workId);

    @PostMapping("teaching/l/work/association-info/{workId}")
    RestResponse modifyWorkInfo(@RequestBody Map<String, Object> params,
                                @PathVariable Long workId);

}
